package com.handpay.zztong.hp.klf;

import java.math.BigDecimal;

public class PaaInfo {
	private char[] merchantId;		// 商户ID,定长15字节，PAA(file)
	private char[] merchantName;		// 商户名称,64个，PAA(file)
	private char[] merchantCountry;	// 商户国家代码,定长3个字中国156，PAA(file)
	private char[] terminalId;		    // 终端ID,定长8位，PAA(file)
	private char[] orderId;			// 订单ID,又称文件流水号，定长8个字符，PAA(file)
	private char[] transCurrency;	    // 交易币种,定长3字符，PAA(file)
	private char[] transAmount;		// 交易金额,定长12字符,不满前补，PAA(file)
	private char[] serviceInfo;		// 服务信息,256字符
	private char[] spId;				// SP代码,定长4字符
	private char[] securityChipType;	// 安全载体类型,定长2字符
	//public String digest[41];			// 商户摘要数据,定长40字符
	//public String signature[257];		// 商户数据签名,定长256字符，PAA(file)
	private char[] type;				// 交易类型,PAA(file)域，字符
	private char[] submitTime;		// 提交时间，订单生成时间，PAA(file)域，,定长14字符
	private char[] sysProvide;         // 系统支持定长8个字符，PAA(file)
	private char[] account2;         // 账户2
	private char[] pSubTime;         // 给银联的支付日期
	//public String orderContent[129];     // 文件信息，PAA(file)
    //public String accountUniqueID[64];   // 无卡支付唯一标识码，定长37字符
    //public String signatureEndcode[33];  // 
	public Double channelFlag;         // 超级转账渠道标识
	public String getTransAmount(){
	
		if(transAmount!=null && String.valueOf(transAmount).length()==12 && String.valueOf(transAmount).indexOf(".")==-1){
			return String.valueOf(transAmount);
		}
		//因java系统原因double - 18.81*100为1880.9998，所以需要使用BigDecimal
		BigDecimal money = new BigDecimal(String.valueOf(transAmount));
		money.multiply(new BigDecimal(100)).intValue();
		String result = "0000000000000"
				+ money.multiply(new BigDecimal(100)).intValue();
		result = result.substring(result.length() - 12);
		return result;
	}
	
	public String getMerchantId()
	{
		return merchantId == null?null:String.valueOf(merchantId);
	}
	public void setMerchantId(String merchantId)
	{
		this.merchantId = VposUtility.toCharArray(merchantId);
	}
	public String getMerchantName()
	{
		return merchantName == null?null:String.valueOf(merchantName);
	}
	public void setMerchantName(String merchantName)
	{
		this.merchantName = VposUtility.toCharArray(merchantName);
	}
	public String getMerchantCountry()
	{
		return merchantCountry == null?null:String.valueOf(merchantCountry);
	}
	public void setMerchantCountry(String merchantCountry)
	{
		this.merchantCountry = VposUtility.toCharArray(merchantCountry);
	}
	public String getTerminalId()
	{
		return terminalId == null?null:String.valueOf(terminalId);
	}
	public void setTerminalId(String terminalId)
	{
		this.terminalId = VposUtility.toCharArray(terminalId);
	}
	public String getOrderId()
	{
		return orderId == null?null:String.valueOf(orderId);
	}
	public void setOrderId(String orderId)
	{
		this.orderId = VposUtility.toCharArray(orderId);
	}
	public String getTransCurrency()
	{
		return transCurrency == null?null:String.valueOf(transCurrency);
	}
	public void setTransCurrency(String transCurrency)
	{
		this.transCurrency = VposUtility.toCharArray(transCurrency);
	}
	public String getServiceInfo()
	{
		return serviceInfo == null?null:String.valueOf(serviceInfo);
	}
	public void setServiceInfo(String serviceInfo)
	{
		this.serviceInfo = VposUtility.toCharArray(serviceInfo);
	}
	public String getSpId()
	{
		return spId == null?null:String.valueOf(spId);
	}
	public void setSpId(String spId)
	{
		this.spId = VposUtility.toCharArray(spId);
		
	}
	public String getSecurityChipType()
	{
		return securityChipType == null?null:String.valueOf(securityChipType);
	}
	public void setSecurityChipType(String securityChipType)
	{
		this.securityChipType = VposUtility.toCharArray(securityChipType);
	}
	public String getType()
	{
		return type == null?null:String.valueOf(type);
	}
	public void setType(String type)
	{
		this.type = VposUtility.toCharArray(type);
	}
	public String getSubmitTime()
	{
		return submitTime == null?null:String.valueOf(submitTime);
	}
	public void setSubmitTime(String submitTime)
	{
		this.submitTime = VposUtility.toCharArray(submitTime);
	}
	public String getSysProvide()
	{
		return sysProvide == null?null:String.valueOf(sysProvide);
	}
	public void setSysProvide(String sysProvide)
	{
		this.sysProvide = VposUtility.toCharArray(sysProvide);
	}
	public String getAccount2()
	{
		return account2 == null?null:String.valueOf(account2);
	}
	public void setAccount2(String account2)
	{
		this.account2 = VposUtility.toCharArray(account2);
	}
	public char[] getpSubTime()
	{
		return pSubTime;
	}
	public void setpSubTime(String pSubTime)
	{
		this.pSubTime = VposUtility.toCharArray(pSubTime);
	}
	public void setTransAmount(String transAmount)
	{
		this.transAmount = VposUtility.toCharArray(transAmount);
	}
}
